\(\int \csc ^3(x) (a \cos (x)+b \sin (x)) \, dx\) [7]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 15 \[ \int \csc ^3(x) (a \cos (x)+b \sin (x)) \, dx=-b \cot (x)-\frac {1}{2} a \csc ^2(x) \]

[Out]

-b*cot(x)-1/2*a*csc(x)^2

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3168, 3852, 8, 2686, 30} \[ \int \csc ^3(x) (a \cos (x)+b \sin (x)) \, dx=-\frac {1}{2} a \csc ^2(x)-b \cot (x) \]

[In]

Int[Csc[x]^3*(a*Cos[x] + b*Sin[x]),x]

[Out]

-(b*Cot[x]) - (a*Csc[x]^2)/2

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2686

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 3168

Int[sin[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_.), x_Sym
bol] :> Int[ExpandTrig[sin[c + d*x]^m*(a*cos[c + d*x] + b*sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d}, x] &&
 IntegerQ[m] && IGtQ[n, 0]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps \begin{align*} \text {integral}& = \int \left (b \csc ^2(x)+a \cot (x) \csc ^2(x)\right ) \, dx \\ & = a \int \cot (x) \csc ^2(x) \, dx+b \int \csc ^2(x) \, dx \\ & = -(a \text {Subst}(\int x \, dx,x,\csc (x)))-b \text {Subst}(\int 1 \, dx,x,\cot (x)) \\ & = -b \cot (x)-\frac {1}{2} a \csc ^2(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \csc ^3(x) (a \cos (x)+b \sin (x)) \, dx=-b \cot (x)-\frac {1}{2} a \csc ^2(x) \]

[In]

Integrate[Csc[x]^3*(a*Cos[x] + b*Sin[x]),x]

[Out]

-(b*Cot[x]) - (a*Csc[x]^2)/2

Maple [A] (verified)

Time = 0.57 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.93

method result size
default \(-\frac {a}{2 \sin \left (x \right )^{2}}-b \cot \left (x \right )\) \(14\)
parts \(-b \cot \left (x \right )-\frac {a \csc \left (x \right )^{2}}{2}\) \(14\)
risch \(-\frac {2 i \left (i a \,{\mathrm e}^{2 i x}+b \,{\mathrm e}^{2 i x}-b \right )}{\left ({\mathrm e}^{2 i x}-1\right )^{2}}\) \(33\)
parallelrisch \(\frac {-a \tan \left (\frac {x}{2}\right )^{4}+4 b \tan \left (\frac {x}{2}\right )^{3}-4 b \tan \left (\frac {x}{2}\right )-a}{8 \tan \left (\frac {x}{2}\right )^{2}}\) \(38\)
norman \(\frac {-\frac {a}{8}-\frac {a \tan \left (\frac {x}{2}\right )^{6}}{8}-\frac {b \tan \left (\frac {x}{2}\right )}{2}+\frac {b \tan \left (\frac {x}{2}\right )^{5}}{2}}{\tan \left (\frac {x}{2}\right )^{2} \left (1+\tan \left (\frac {x}{2}\right )^{2}\right )}\) \(47\)

[In]

int(csc(x)^3*(a*cos(x)+b*sin(x)),x,method=_RETURNVERBOSE)

[Out]

-1/2*a/sin(x)^2-b*cot(x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.27 \[ \int \csc ^3(x) (a \cos (x)+b \sin (x)) \, dx=\frac {2 \, b \cos \left (x\right ) \sin \left (x\right ) + a}{2 \, {\left (\cos \left (x\right )^{2} - 1\right )}} \]

[In]

integrate(csc(x)^3*(a*cos(x)+b*sin(x)),x, algorithm="fricas")

[Out]

1/2*(2*b*cos(x)*sin(x) + a)/(cos(x)^2 - 1)

Sympy [A] (verification not implemented)

Time = 1.84 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.13 \[ \int \csc ^3(x) (a \cos (x)+b \sin (x)) \, dx=- \frac {a}{2 \sin ^{2}{\left (x \right )}} - \frac {b \cos {\left (x \right )}}{\sin {\left (x \right )}} \]

[In]

integrate(csc(x)**3*(a*cos(x)+b*sin(x)),x)

[Out]

-a/(2*sin(x)**2) - b*cos(x)/sin(x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \csc ^3(x) (a \cos (x)+b \sin (x)) \, dx=-\frac {b}{\tan \left (x\right )} - \frac {a}{2 \, \sin \left (x\right )^{2}} \]

[In]

integrate(csc(x)^3*(a*cos(x)+b*sin(x)),x, algorithm="maxima")

[Out]

-b/tan(x) - 1/2*a/sin(x)^2

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.87 \[ \int \csc ^3(x) (a \cos (x)+b \sin (x)) \, dx=-\frac {2 \, b \tan \left (x\right ) + a}{2 \, \tan \left (x\right )^{2}} \]

[In]

integrate(csc(x)^3*(a*cos(x)+b*sin(x)),x, algorithm="giac")

[Out]

-1/2*(2*b*tan(x) + a)/tan(x)^2

Mupad [B] (verification not implemented)

Time = 20.82 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.93 \[ \int \csc ^3(x) (a \cos (x)+b \sin (x)) \, dx=-\frac {a+b\,\sin \left (2\,x\right )}{2\,{\sin \left (x\right )}^2} \]

[In]

int((a*cos(x) + b*sin(x))/sin(x)^3,x)

[Out]

-(a + b*sin(2*x))/(2*sin(x)^2)